import { requestSearchPort } from './searchHttp'

//接第三方搜索问题库
export function getProblemSearch(params) {
	return requestSearchPort({
		baseUrl: 'https://xzcssearch.api.xzcs2022.com',
		url: '/qa/search',
		method: 'POST',
		params: params
	});
}

// 接第三方搜索税收和优惠
export function getTaxSearch(params) {
	return requestSearchPort({
		baseUrl: 'https://xzcssearch.api.xzcs2022.com',
		url: '/document/policy/search',
		method: 'POST',
		params: params
	});
}

// 接第三方搜索会计
export function getAcctSearch(params) {
	return requestSearchPort({
		baseUrl: 'https://xzcssearch.api.xzcs2022.com',
		url: '/document/norm/search',
		method: 'POST',
		params: params
	});
}


// 第三方接口返回JSON数据，重新请求
export function readJsonFileContent(jsonfileUrl) {
	let httpDefaultOpts = {
		url: jsonfileUrl,
		timeout: 20000,
		dataType: 'json'
	}
	return new Promise(function (resolve, reject) {
		uni.request(httpDefaultOpts).then(
			(res) => {
				resolve(res.data);
			}
		).catch(
			(response) => {
				reject(response)
			}
		)

	})
};